Global Shadow Mask Default Slice1
(global_shadow_mask:default:SLICE1
, 0xa0778e9ff2268a7f
)
This template is referenced 1 time by global_shadow_mask:SLICE1.
Technique ambient
Render States
More info can be found on the Direct3D Docs
enum D3DRENDERSTATETYPE {
D3DRS_ZENABLE = 1,
D3DRS_ZFUNC = 7,
D3DRS_ZWRITEENABLE = 0,
D3DRS_ALPHABLENDENABLE = 0,
D3DRS_CULLMODE = 1,
D3DRS_COLORWRITEENABLE = 8,
D3DRS_COLORWRITEENABLE1 = 15,
D3DRS_COLORWRITEENABLE2 = 15,
D3DRS_STENCILENABLE = 0,
D3DRS_STENCILFUNC = 1,
D3DRS_STENCILFAIL = 1,
D3DRS_STENCILMASK = 0,
D3DRS_STENCILPASS = 1,
D3DRS_STENCILREF = 0,
D3DRS_STENCILWRITEMASK = 0,
D3DRS_STENCILZFAIL = 1,
D3DRS_DEPTHBIAS = 0,
D3DRS_SLOPESCALEDEPTHBIAS = 0,
D3DRS_FOGENABLE = 0,
D3DRS_SPECULARENABLE = 0,
D3DRS_ADAPTIVETESS_X = 0,
D3DRS_ADAPTIVETESS_Z = 0,
D3DRS_ADAPTIVETESS_W = 0,
D3DRS_SRGBWRITEENABLE = 0,
D3DRS_SEPARATEALPHABLENDENABLE = 0,
D3DRS_ALPHATESTENABLE = 0,
};
Sampler States
More info can be found on the Direct3D Docs
Sampler 0
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 1,
D3DSAMP_MINFILTER = 1,
D3DSAMP_MIPFILTER = 1,
};
Sampler 1
enum D3DSAMPLERSTATETYPE {
D3DSAMP_MIPMAPLODBIAS = 827606343,
D3DSAMP_SRGBTEXTURE = 0,
D3DSAMP_ADDRESSU = 3,
D3DSAMP_ADDRESSV = 3,
D3DSAMP_MAGFILTER = 1,
D3DSAMP_MINFILTER = 1,
D3DSAMP_MIPFILTER = 1,
};
Shaders
Vertex Shader
column_major float4x4 camera_inv_view_matrix : register(vs_3_0, c4);
float3 camera_unprojection : register(vs_3_0, c7);
float ref_depth_clip_space : register(vs_3_0, c8);
column_major float4x4 view_proj_matrix : register(vs_3_0, c0);
struct VertexMain_Input
{
float4 position : POSITION;
float4 texcoord : TEXCOORD;
};
struct VertexMain_Output
{
float4 position : POSITION;
float2 texcoord : TEXCOORD;
float3 texcoord1 : TEXCOORD1;
};
VertexMain_Output VertexMain(VertexMain_Input i)
{
VertexMain_Output o;
float2 temp0;
float3 temp1;
// def c9, 1, 0, 0, 0
// dcl_position v0
// dcl_texcoord v1
// dcl_position o0
// dcl_texcoord o1.xy
// dcl_texcoord1 o2.xyz
// dp4 o0.w, v0, c3
o.position.w = dot(i.position, (view_proj_matrix._m03_m13_m23_m33));
// dp4 r0.x, v0, c0
temp0.x = dot(i.position, (view_proj_matrix._m00_m10_m20_m30));
// dp4 r0.y, v0, c1
temp0.y = dot(i.position, (view_proj_matrix._m01_m11_m21_m31));
// mul r1.xy, r0, c7
temp1.xy = temp0.xy * camera_unprojection.xy;
// mov o0.xy, r0
o.position.xy = temp0.xy;
// mov r1.z, c9.x
temp1.z = float1(1);
// dp3 o2.x, r1, c4
o.texcoord1.x = dot(temp1.xyz, (camera_inv_view_matrix._m00_m10_m20_m30).xyz);
// dp3 o2.y, r1, c5
o.texcoord1.y = dot(temp1.xyz, (camera_inv_view_matrix._m01_m11_m21_m31).xyz);
// dp3 o2.z, r1, c6
o.texcoord1.z = dot(temp1.xyz, (camera_inv_view_matrix._m02_m12_m22_m32).xyz);
// mov o0.z, c8.x
o.position.z = ref_depth_clip_space.x;
// mov o1.xy, v1
o.texcoord = i.texcoord;
//
return o;
}
Decompiled by DXDecompiler.
Pixel Shader
column_major float4x4 camera_world_matrix : register(ps_3_0, c11);
sampler2D depth : register(ps_3_0, s0);
sampler2D displacement_texture : register(ps_3_0, s1);
float3 displacement_texture_size : register(ps_3_0, c16);
column_major float4x4 global_shadow_projection[3] : register(ps_3_0, c0);
float3 ref_shadow_slice_depths : register(ps_3_0, c14);
float3 ref_shadow_slice_overlap : register(ps_3_0, c15);
struct PixelMain_Input
{
float2 texcoord : TEXCOORD;
float3 texcoord1 : TEXCOORD1;
};
float4 PixelMain(PixelMain_Input i) : COLOR
{
float4 out_color;
float4 temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
// def c17, -0.5, 0.5, 0, 0
// def c18, 0, 1, 2, 0
// dcl_texcoord v0.xy
// dcl_texcoord1 v1.xyz
// dcl_2d s0
// dcl_2d s1
// rcp r0.x, c16.x
temp0.x = 1.0f / displacement_texture_size.x;
// rcp r0.y, c16.y
temp0.y = 1.0f / displacement_texture_size.y;
// texld r1, v0, s0
temp1 = tex2D(depth, i.texcoord.xy);
// add r0.zw, -r1.x, c14.xyyx
temp0.zw = -temp1.xx + ref_shadow_slice_depths.yx;
// cmp r0.w, r0.w, c18.x, c18.y
temp0.w = (temp0.w >= 0) ? float1(0) : float1(1);
// cmp r0.z, r0.z, r0.w, c18.z
temp0.z = (temp0.z >= 0) ? temp0.w : float1(2);
// add r1.yzw, r0.z, -c18.xxyz
temp1.yzw = temp0.zzz + float3(-0, -1, -2);
// mov r2.x, c18.x
temp2.x = float1(0);
// cmp r3, -r1_abs.y, c0, r2.x
temp3 = (-abs(temp1).y >= 0) ? (global_shadow_projection[0]._m00_m10_m20_m30) : temp2.x;
// cmp r3, -r1_abs.z, c4, r3
temp3 = (-abs(temp1).z >= 0) ? (global_shadow_projection[1]._m00_m10_m20_m30) : temp3;
// cmp r3, -r1_abs.w, c8, r3
temp3 = (-abs(temp1).w >= 0) ? (global_shadow_projection[2]._m00_m10_m20_m30) : temp3;
// mov r4.w, c18.y
temp4.w = float1(1);
// mad r4.x, v1.x, r1.x, c11.w
temp4.x = i.texcoord1.x * temp1.x + (camera_world_matrix._m00_m10_m20_m30).w;
// mad r4.y, v1.y, r1.x, c12.w
temp4.y = i.texcoord1.y * temp1.x + (camera_world_matrix._m01_m11_m21_m31).w;
// mad r4.z, v1.z, r1.x, c13.w
temp4.z = i.texcoord1.z * temp1.x + (camera_world_matrix._m02_m12_m22_m32).w;
// dp4 r3.x, r4, r3
temp3.x = dot(temp4, temp3);
// cmp r5, -r1_abs.y, c1, r2.x
temp5 = (-abs(temp1).y >= 0) ? (global_shadow_projection[0]._m01_m11_m21_m31) : temp2.x;
// cmp r5, -r1_abs.z, c5, r5
temp5 = (-abs(temp1).z >= 0) ? (global_shadow_projection[1]._m01_m11_m21_m31) : temp5;
// cmp r5, -r1_abs.w, c9, r5
temp5 = (-abs(temp1).w >= 0) ? (global_shadow_projection[2]._m01_m11_m21_m31) : temp5;
// dp4 r3.y, r4, r5
temp3.y = dot(temp4, temp5);
// mad r5, r0.xyxy, c17.xxyx, r3.xyxy
temp5 = temp0.xyxy * float4(-0.5, -0.5, 0.5, -0.5) + temp3.xyxy;
// mad r3, r0.xyxy, c17.yyxy, r3.xyxy
temp3 = temp0.xyxy * float4(0.5, 0.5, -0.5, 0.5) + temp3.xyxy;
// texld r6, r5, s1
temp6 = tex2D(displacement_texture, temp5.xy);
// texld r5, r5.zwzw, s1
temp5 = tex2D(displacement_texture, temp5.zw);
// mov r6.y, r5.x
temp6.y = temp5.x;
// texld r5, r3, s1
temp5 = tex2D(displacement_texture, temp3.xy);
// mov r6.z, r5.x
temp6.z = temp5.x;
// texld r5, r3.zwzw, s1
temp5 = tex2D(displacement_texture, temp3.zw);
// mul r2.yz, r3.xxyw, c16.xxyw
temp2.yz = temp3.xy * displacement_texture_size.xy;
// frc r3.xy, r2.yzzw
temp3.xy = frac(temp2.yz);
// mov r6.w, r5.x
temp6.w = temp5.x;
// cmp r5, -r1_abs.y, c2, r2.x
temp5 = (-abs(temp1).y >= 0) ? (global_shadow_projection[0]._m02_m12_m22_m32) : temp2.x;
// cmp r5, -r1_abs.z, c6, r5
temp5 = (-abs(temp1).z >= 0) ? (global_shadow_projection[1]._m02_m12_m22_m32) : temp5;
// cmp r5, -r1_abs.w, c10, r5
temp5 = (-abs(temp1).w >= 0) ? (global_shadow_projection[2]._m02_m12_m22_m32) : temp5;
// dp4 r0.w, r4, r5
temp0.w = dot(temp4, temp5);
// add r5, -r6, r0.w
temp5 = -temp6 + temp0.w;
// cmp r5, r5, c18.x, c18.y
temp5 = (temp5 >= 0) ? float4(0, 0, 0, 0) : float4(1, 1, 1, 1);
// add r3.zw, -r3.xyxy, c18.y
temp3.zw = -temp3.xy + float2(1, 1);
// mul r3, r3.wwyy, r3.zxxz
temp3 = temp3.wwyy * temp3.zxxz;
// dp4 r0.w, r5, r3
temp0.w = dot(temp5, temp3);
// mov r3.xyz, c14
temp3.xyz = ref_shadow_slice_depths.xyz;
// add r1.yzw, r3.xyxz, -c15.xyxz
temp1.yzw = temp3.yxz + -ref_shadow_slice_overlap.yxz;
// add r2.yzw, -r1.x, r1
temp2.yzw = -temp1.xxx + temp1.yzw;
// add r1.y, -r1.w, r1.x
temp1.y = -temp1.w + temp1.x;
// cmp r1.z, r2.z, c18.x, c18.y
temp1.z = (temp2.z >= 0) ? float1(0) : float1(1);
// cmp r1.z, r2.y, r1.z, c18.z
temp1.z = (temp2.y >= 0) ? temp1.z : float1(2);
// add r3.xyz, r1.z, -c18
temp3.xyz = temp1.zzz + float3(-0, -1, -2);
// cmp r5, -r3_abs.x, c0, r2.x
temp5 = (-abs(temp3).x >= 0) ? (global_shadow_projection[0]._m00_m10_m20_m30) : temp2.x;
// cmp r5, -r3_abs.y, c4, r5
temp5 = (-abs(temp3).y >= 0) ? (global_shadow_projection[1]._m00_m10_m20_m30) : temp5;
// cmp r5, -r3_abs.z, c8, r5
temp5 = (-abs(temp3).z >= 0) ? (global_shadow_projection[2]._m00_m10_m20_m30) : temp5;
// dp4 r5.x, r4, r5
temp5.x = dot(temp4, temp5);
// cmp r6, -r3_abs.x, c1, r2.x
temp6 = (-abs(temp3).x >= 0) ? (global_shadow_projection[0]._m01_m11_m21_m31) : temp2.x;
// cmp r6, -r3_abs.y, c5, r6
temp6 = (-abs(temp3).y >= 0) ? (global_shadow_projection[1]._m01_m11_m21_m31) : temp6;
// cmp r6, -r3_abs.z, c9, r6
temp6 = (-abs(temp3).z >= 0) ? (global_shadow_projection[2]._m01_m11_m21_m31) : temp6;
// dp4 r5.y, r4, r6
temp5.y = dot(temp4, temp6);
// mad r6, r0.xyxy, c17.xxyx, r5.xyxy
temp6 = temp0.xyxy * float4(-0.5, -0.5, 0.5, -0.5) + temp5.xyxy;
// mad r5, r0.xyxy, c17.yyxy, r5.xyxy
temp5 = temp0.xyxy * float4(0.5, 0.5, -0.5, 0.5) + temp5.xyxy;
// texld r7, r6, s1
temp7 = tex2D(displacement_texture, temp6.xy);
// texld r6, r6.zwzw, s1
temp6 = tex2D(displacement_texture, temp6.zw);
// mov r7.y, r6.x
temp7.y = temp6.x;
// texld r6, r5, s1
temp6 = tex2D(displacement_texture, temp5.xy);
// mov r7.z, r6.x
temp7.z = temp6.x;
// texld r6, r5.zwzw, s1
temp6 = tex2D(displacement_texture, temp5.zw);
// mul r0.xy, r5, c16
temp0.xy = temp5.xy * displacement_texture_size.xy;
// frc r5.xy, r0
temp5.xy = frac(temp0.xy);
// mov r7.w, r6.x
temp7.w = temp6.x;
// cmp r6, -r3_abs.x, c2, r2.x
temp6 = (-abs(temp3).x >= 0) ? (global_shadow_projection[0]._m02_m12_m22_m32) : temp2.x;
// cmp r6, -r3_abs.y, c6, r6
temp6 = (-abs(temp3).y >= 0) ? (global_shadow_projection[1]._m02_m12_m22_m32) : temp6;
// cmp r3, -r3_abs.z, c10, r6
temp3 = (-abs(temp3).z >= 0) ? (global_shadow_projection[2]._m02_m12_m22_m32) : temp6;
// dp4 r0.x, r4, r3
temp0.x = dot(temp4, temp3);
// add r3, -r7, r0.x
temp3 = -temp7 + temp0.x;
// cmp r3, r3, c18.x, c18.y
temp3 = (temp3 >= 0) ? float4(0, 0, 0, 0) : float4(1, 1, 1, 1);
// add r5.zw, -r5.xyxy, c18.y
temp5.zw = -temp5.xy + float2(1, 1);
// mul r4, r5.wwyy, r5.zxxz
temp4 = temp5.wwyy * temp5.zxxz;
// dp4 r0.x, r3, r4
temp0.x = dot(temp3, temp4);
// add r2.yz, r1.z, -c18
temp2.yz = temp1.zz + float2(-1, -2);
// add r0.y, r0.z, -r1.z
temp0.y = temp0.z + -temp1.z;
// cmp r1.zw, -r2_abs.xyyz, c18.y, c18.x
temp1.zw = (-abs(temp2).yz >= 0) ? float2(1, 1) : float2(0, 0);
// dp2add r0.z, c14, r1.zwzw, -r1.x
temp0.z = dot(ref_shadow_slice_depths.xy, temp1.zw) + -temp1.x;
// dp2add r1.x, c15, r1.zwzw, r2.x
temp1.x = dot(ref_shadow_slice_overlap.xy, temp1.zw) + temp2.x;
// rcp r1.x, r1.x
temp1.x = 1.0f / temp1.x;
// mul r0.z, r0.z, r1.x
temp0.z = temp0.z * temp1.x;
// lrp r1.x, r0.z, r0.w, r0.x
temp1.x = lerp(temp0.x, temp0.w, temp0.z);
// cmp r0.x, -r0_abs.y, r0.w, r1.x
temp0.x = (-abs(temp0).y >= 0) ? temp0.w : temp1.x;
// rcp r0.y, c15.z
temp0.y = 1.0f / ref_shadow_slice_overlap.z;
// mul_sat r0.y, r0.y, r1.y
temp0.y = saturate(temp0.y * temp1.y);
// add_sat r0.y, r0.y, r0.x
temp0.y = saturate(temp0.y + temp0.x);
// cmp oC0, r2.w, r0.x, r0.y
out_color = (temp2.w >= 0) ? temp0.x : temp0.y;
//
return out_color;
}
Decompiled by DXDecompiler.